home *** CD-ROM | disk | FTP | other *** search
-
- #include <string.h>
-
- #define KEEP_ALPHABET_DEFINES
-
- #include "NString.h"
- #include "Alphabet.h"
- #include "Alphabet_Private.h"
-
- //________________________________________________________________________
-
- Alphabet& Alphabet::operator+= (const char *source)
- {
- unsigned long int i;
-
- for (i = 0; i < strlen(source); i++)
- SET_ELT(source[i]);
-
- return *this;
- }
-
- //________________________________________________________________________
-
- Alphabet& Alphabet::operator+= (const NString& source)
- {
- unsigned long int i;
-
- for (i = 0; i < source.sb->len; i++)
- SET_ELT(source.sb->str[i]);
-
- return *this;
- }
-
- //________________________________________________________________________
-
- Alphabet& Alphabet::operator-= (const char *source)
- {
- unsigned long int i;
-
- for (i = 0; i < strlen(source); i++)
- CLR_ELT(source[i]);
-
- return *this;
- }
-
- //________________________________________________________________________
-
- Alphabet& Alphabet::operator-= (const NString& source)
- {
- unsigned long int i;
-
- for (i = 0; i < source.sb->len; i++)
- CLR_ELT(source.sb->str[i]);
-
- return *this;
- }
-
- //________________________________________________________________________
-
- int Alphabet::contains (const char *elements) const
- {
- unsigned long int i;
-
- for (i = 0; i < strlen(elements); i++)
- if (! ELT(elements[i]))
- return 0;
-
- return 1;
- }
-
- //________________________________________________________________________
-
- int Alphabet::contains (const NString& elements) const
- {
- unsigned long int i;
-
- for (i = 0; i < elements.sb->len; i++)
- if (! ELT(elements.sb->str[i]))
- return 0;
-
- return 1;
- }
-